package com.jh.loadbalance.server.mvc.advice;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.io.PrintWriter;

@RestControllerAdvice
public class CircuitBreakerControllerAdvice {

    // @ExceptionHandler(value = {IndexOutOfBoundsException.class}) // 捕获某一种异常
    @ExceptionHandler // 捕获所有异常
    public void onTimeoutException(Exception ex, PrintWriter printWriter) {
        /*printWriter.write("Fault");
        printWriter.flush();*/
    }

}
